//
//  ModifyPasswordViewController.m
//  OAProject
//
//  Created by yhj on 2017/7/10.
//  Copyright © 2017年 cdnunion. All rights reserved.
//  修改密码主界面

#import "ModifyPasswordViewController.h"


@implementation ModifyPasswordViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.

    self.title=@"修改密码";

    UIView *bgView=[[UIView alloc]initWithFrame:CGRectMake(0,74,APPW,50*2)];
    bgView.backgroundColor=WhiteColor;
    [self.view addSubview:bgView];

    NSArray *placeholderArr=@[@"请输入您的新密码",@"请再次输入您的新密码"];
    for (NSInteger i=0;i<2;i++)
    {
        UITextField *textTF=[[UITextField alloc]initWithFrame:CGRectMake(kmargin*2,(i%2)*50,APPW-kmargin*4,50)];
        textTF.placeholder=placeholderArr[i];
        textTF.tag=1000+i;
        textTF.textColor=LightGreyColor;
        [bgView addSubview:textTF];

        UIView *lineView=[[UIView alloc]initWithFrame:CGRectMake(kmargin*2,49,APPW,1)];
        lineView.backgroundColor=LightGreyColor;
        [bgView addSubview:lineView];
    }

    UIButton *submitBtn=[AppUI createButtonWithText:@"提交" andWithTextColor:WhiteColor andWithFontfloat:18 andWithBtnAction:^{
        [self modifyPasswordSubmitService];
    }];
    submitBtn.backgroundColor=MainColor;
    ViewBorderRadius(submitBtn,kmargin,1,ClearColor);
    [self.view addSubview:submitBtn];
    submitBtn.frame=CGRectMake(kmargin*2,CGRectGetMaxY(bgView.frame)+kmargin*2,APPW-kmargin*4,kmargin*4);
}

-(void)modifyPasswordSubmitService
{
    UITextField *passwordTF=(UITextField *)[self.view viewWithTag:1000];
    UITextField *againpasswordTF=(UITextField *)[self.view viewWithTag:1001];
    if (passwordTF.text.length==0)
    {
        [self.view makeToast:@"请输入您的新密码" duration:1 position:CSToastPositionCenter];
    }
    else if (againpasswordTF.text.length==0)
    {
      [self.view makeToast:@"请再次输入您的新密码" duration:1 position:CSToastPositionCenter];
    }
    else
    {

    }
}

@end
